package com.zkthink.ceres.member.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

/**
 * @Author Xiaoyan
 * @create 2021/12/14 17:49
 */
@Getter
public enum GiftTypeEnum {
    RECEIVE(0, "接收"),
    GIVE(1, "赠送");

    private Integer code;

    private String desc;

    GiftTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static GiftTypeEnum getDscByType(Integer type) {
        for (GiftTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}
